<%@ page contentType="text/html;charset=UTF-8"%>
<%@ page isELIgnored="false"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<div class='pageDiv'>
	<div class='right'>
		<c:if test="${realPage-1>0}">
			<a class="prev" href="index.do?mod=topic&id=${topic.id}&page=${realPage-1}">&nbsp;</a>
		</c:if>
		<c:forEach var="i" begin="1" end="4" step="1">
			<c:if test="${realPage-5+i>0}">
				<a href="index.do?mod=topic&id=${topic.id}&page=${realPage-5+i}">${realPage-5+i}</a>
			</c:if>
		</c:forEach>
		<label>${realPage}</label>
		<c:forEach var="i" begin="1" end="4" step="1">
			<c:if test="${realPage+i>0 and realPage+i<=postPageCount}">
				<a href="index.do?mod=topic&id=${topic.id}&page=${realPage+i}">${realPage+i}</a>
			</c:if>
		</c:forEach>
		<c:if test="${realPage < postPageCount}">
			<a class="next" href="index.do?mod=topic&id=${topic.id}&page=${realPage+1}">&nbsp;</a>
		</c:if>
		<label><input id="jumpPageInput${param.jumpPageInput}" class='jumpPageInput'/>&nbsp;/&nbsp;${postPageCount}页</label>
		<script>
		$(function(){
			$('#jumpPageInput${param.jumpPageInput}').keydown(function(event){
				if(event.keyCode==13){
					if(!isNaN($(this).val())){
						window.location = 'index.do?mod=topic&id=${topic.id}&page=' + $(this).val();
					}
				}  
			});  
		});
		</script>
	</div>
</div>